<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<div class="row" th:fragment="noramlList(tableName)">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">

            <div class="x_content">
                <table th:id="${tableName}" class="table table-striped table-bordered">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>用户名</th>
                        <th>性别</th>
                        <th>真实姓名</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody></tbody>
                </table>
            </div>
        </div>
    </div>
    <script>
        // dataTable数据初始化
        const columns = [
            {data: 'id'},
            {data: 'username'},
            {
                data: 'sex',
                render: function (data) {
                    let text = data == 1 ? '男性' : '女性';
                    return $c.label(text, data);
                }
            },
            {data: 'trueName'},
            {
                'data': 'id',
                'width': '160px',
                "render": function (data, type, row) {
                    let html = '';
                    html += $c.button('基本信息', "editUser(" + data + ")", 'success');
                    html += $c.button('用户足迹', "foot(" + data + ")", 'warning');
                    html += $c.button('删除', "delUser(" + data + ")", 'danger');
                    return html;
                },
            }
        ];
    </script>
</div>
</html>
